/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package be.darling.scrt.configuration;

import java.util.HashMap;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Node;

/**
 *
 * @author jingle
 */
public class PluginData {

    private String type;
    private String name;
    private String className;
        //DOM NODE
    private HashMap<String, String> hashOptions;
    private Node DOMNodeOptions;
    private String description;

    public PluginData(String type, String name, String className, HashMap<String, String>options)
    {
            this(type, name, className, options, null, null);
    }

    public PluginData(String type, String name, String className, HashMap<String, String>options, Node DOMNodeOptions)
    {
            this(type, name, className, options, DOMNodeOptions, null);
    }

    public PluginData(String type, String name, String className, HashMap<String, String>hashOptions, Node DOMNodeOptions, String description)
    {
        this.type = type;
        this.name = name;
        this.className = className;
        this.hashOptions = (hashOptions==null?new HashMap<String, String>():hashOptions);
        this.DOMNodeOptions = DOMNodeOptions;
        this.description = (description==null?"":description);
    }

    public String getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public String getClassName() {
        return className;
    }

    public Object getOptions(Class cl) {
        Object obj = null;
        if(cl.getSimpleName().equals("HashMap") )
            obj = hashOptions;

        else if(cl.getSimpleName().equals("Node") )
            obj = DOMNodeOptions;

        return obj;
    }

    public String getDescription() {
        return description;
    }

    
}
